﻿using System;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Microsoft.VisualStudio.TestTools.UnitTesting;



namespace CodedUITestProject1
{
    /// <summary>
    /// Summary description for CodedUITest1
    /// </summary>
    [CodedUITest]
    public class SampleTest
    {
        public SampleTest()
        {
            addPosition();
        }


        [TestMethod]

        public void addPosition()
        {
            // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
            // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463

            otherGlobalFunctions.setPlaybackSettings();

            globalDOTNETFunctions.Table_SelectRow("Positions", "Window", "DataGridView", "Table", "3");

            globalDOTNETFunctions.Textbox_EnterText(objectRepository.oPositionsWinName, objectRepository.oPositionsWinClassName, objectRepository.oPositionsNameTxtbox, objectRepository.oPositionsNameTxtboxControlType, testData.strPositionName);
            //The above example of Textbox_enterText is the right way of passing arguments, rest of the examples have hardcoded arguments

            globalDOTNETFunctions.Combo_SelectValue("Positions", "Window", "Department", "ComboBox", "Accounting");

            globalDOTNETFunctions.CheckBox_Select("Positions", "Window", "View Encrypted Data", "CheckBox");

            globalDOTNETFunctions.Button_Click("Confirm", "#32770", "No", "Button");


        }

        #region Additional test attributes

        // You can use the following additional attributes as you write your tests:

        ////Use TestInitialize to run code before running each test 
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{        
        //    // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
        //    // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
        //}

        ////Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{        
        //    // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
        //    // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
        //}

        #endregion

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }
        private TestContext testContextInstance;

        

        
    }
}
